@extends('layouts.app')

@section('content')



<script src="{{ URL::asset('/') }}js/html2canvas.js"></script>




<script type="text/javascript">
function takeScreenshot() {
  console.log('test');
    html2canvas(document.getElementById('view'), {
        onrendered: function(canvas) {
            console.log(canvas);
            var myImage = canvas.toDataURL("image/jpeg");  //base64
             console.log(myImage);

             var urls = "{{url('admin/case/upbhg')}}";
             var casid = "{{$case->case_id}}";
             

            //并将图片上传到服务器用作图片分享  
            $.ajax({  
                type : "POST",  
                url : urls,  
                 data: {'img':myImage,'_token':'{{csrf_token()}}','caseid':casid},
                dateType: 'json',    
               
                success : function(data){
                    var obj = eval( "(" + data + ")" );
                     console.log(obj);
                     if (obj.style == 1) {
                       alert(obj.message);
                       self.location= "{{url('admin/case/index')}}"; 
                     }
                    
                    // $('#myShowImage').attr('src', '${ctxStatic}/usertemp/'+data+'.jpg'); //服务器上保存图片路径，data是返回的文件名。  
                }  
            });  

            
        },
      width: 900,
      height: 955,
    });
}
</script>




     <div class="content">
        <div class="main-content">
            <div class="row">

              <button class="btn btn-primary" onclick="takeScreenshot()">提交</button>
              <a href="javascript:history.back(-1);" class="btn btn-back">返回</a>

                <div class="form" id="view" style="background-color: #FFF;width:900px;height:955px;">
                  <div class="table">
                    <div class="center-block">
                      <span class="input_tit">{{$user->name}}</span>
                    </div>
                    <h1 class="form_tit">复查意见告知书</h1>
                    <div class="form_head_r">
                      X公（<p class="input_hd"></p>）复字〔<p class="input_hd"></p>〕第<p class="input_hd"></p>号
                    </div>
                    <div class="form_t"><p class="input_n">您好</p>；</div>
                    <div class="form_n">
                      <p class="tx_d2">
                        根据《公安机关监督检查企业事业单位内部治安保卫工作规定》第十条规定，我单位工作人员于{{$hg->check_time}}，对你单位执行《责令限期整改治安隐患通知书》（X公（<span class="w80 bdno"></span>）限字〔<span class="w80 bdno"></span>〕第<span class="w80 bdno"></span>号）的情况进行了复查，认为：<span  class="form_n_txt">{{$hg->cont}}</span>

                        @if($hg->guiding == 1)已达到@else未达到@endif规定要求，复查验收@if($hg->type == 1)合格@else不合格@endif。
                      </p>
                    </div>
                    <p class="ph1"></p>
                    <div class="form_right">
                      <p>（公安机关印章）</p>
                      <div class="form_time">
                        <span class="w80 bdno"></span>年<span class="w80 bdno"></span>月<span class="w80 bdno"></span>日
                      </div>
                    </div>
                    <div class="form_unit">
                      <p>被复查单位：<span class="input_b bdno">{{$unit->name}}</span></p> 
                      <div class="dsp">
                        <span class="w80 bdno"></span>{{$hg->add_time}}
                      </div>
                    </div>
                  </div>
             
                </div>      
         
        </div>
      </div>

           
        </div>

   


@stop
